package com.lemon.cloud.security.enums;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;

@Getter
@AllArgsConstructor
public enum GrantTypeEnum {
    /**
     * 密码
     */
    PASSWORD("password","密码登录", Maps.newHashMap()),

    /**
     * 验证码授权登录
     */
    MOBILE_CODE("mobile_code","验证码授权登录", Maps.newHashMap(ImmutableMap.of(MobileCodeParams.MOBILE, true))),

    /**
     * 微信公众号授权登录
     */
    WECHAT_MP_CODE("wechat_mp_code","微信公众号授权登录", Maps.newHashMap(ImmutableMap.of(WeChatMpCodeParams.STATE, true,
            WeChatMpCodeParams.CODE, true,
            WeChatMpCodeParams.APPID,true))),

    /**
     * 社交登录
     */
    SOCIAL("social","社交登录", Maps.newHashMap()),
    ;
    private final String type;

    private final String name;

    /**
     * key，required
     */
    private final HashMap<String,Boolean> params;
}
